<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"><head>


<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="ProgId" content="Word.Document">
<meta name="Generator" content="Microsoft Word 10">
<meta name="Originator" content="Microsoft Word 10">
<link rel="File-List" href="http://online-judge.uva.es/p/v103/p8_files/filelist.xml">
<link rel="Edit-Time-Data" href="http://online-judge.uva.es/p/v103/p8_files/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Problem I - September 2002 Monthly Contest</title>
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"></o:smarttagtype>
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"></o:smarttagtype>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>Shahriar Manzoor</o:Author>
  <o:LastAuthor>Shahriar Manzoor</o:LastAuthor>
  <o:Revision>48</o:Revision>
  <o:TotalTime>65</o:TotalTime>
  <o:LastPrinted>2002-09-09T07:50:00Z</o:LastPrinted>
  <o:Created>2002-07-24T06:18:00Z</o:Created>
  <o:LastSaved>2002-09-09T07:50:00Z</o:LastSaved>
  <o:Pages>1</o:Pages>
  <o:Words>344</o:Words>
  <o:Characters>1964</o:Characters>
  <o:Company>BUET</o:Company>
  <o:Lines>16</o:Lines>
  <o:Paragraphs>4</o:Paragraphs>
  <o:CharactersWithSpaces>2304</o:CharactersWithSpaces>
  <o:Version>10.2625</o:Version>
 </o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Print</w:View>
  <w:Zoom>BestFit</w:Zoom>
  <w:GrammarState>Clean</w:GrammarState>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if !mso]><object
 classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
<style>
st1\:*{behavior:url(#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Courier;
	panose-1:2 7 4 9 2 2 5 2 4 4;
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:3 0 0 0 1 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
h3
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:3;
	font-size:13.5pt;
	font-family:"Times New Roman";
	font-weight:bold;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
code
	{font-family:"Courier New";
	mso-ascii-font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";
	mso-hansi-font-family:"Courier New";
	mso-bidi-font-family:"Courier New";}
pre
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head><body style="" lang="EN-US">

<div class="Section1">

<p class="MsoNormal" style="text-align: center;" align="center"><b style=""><span style="font-size: 18pt; color: black;">Problem I<o:p></o:p></span></b></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b style=""><span style="font-size: 24pt; color: black;">Automatic Poetry </span></b><b style=""><span style="color: black;"><o:p></o:p></span></b></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b><span style="color: black;">Input: </span></b><span style="color: black;">standard input<o:p></o:p></span></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b><span style="color: black;">Output: </span></b><span style="color: black;">standard
output<o:p></o:p></span></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b><span style="color: black;">Time Limit:</span></b><span style="color: black;"> 2 seconds<o:p></o:p></span></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b style=""><span style="color: black;">Memory Limit: </span></b><span style="color: black;">32 MB<o:p></o:p></span></p>

<div>

<p class="MsoNormal" style="text-align: justify;"><o:p>&nbsp;</o:p></p>

</div>

<p class="MsoNormal" style="text-align: justify;">&#8220;Oh God&#8221;, Lara Croft exclaims, &#8220;<span class="GramE">it&#8217;s</span> one of these dumb riddles again!&#8221;</p>

<p class="MsoNormal" style="text-align: justify;"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal" style="text-align: justify;">In Tomb Raider XIV, Lara is, as ever, gunning her way through
ancient Egyptian pyramids, prehistoric caves and medival hallways. Now she is
standing in front of some important Germanic looking doorway and has to solve a
linguistic riddle to pass. As usual, the riddle is not very intellectually
challenging.</p>

<p class="MsoNormal" style="text-align: justify;"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal" style="text-align: justify;">This time, the riddle involves poems containing a
&#8220;Schuttelreim&#8221;. An example of a Schuttelreim is the following short
poem:</p>

<p class="MsoNormal" style="text-align: justify;"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal" style="text-align: justify;">Ein Kind <span class="GramE">halt</span> seinen Schnabel
nur,</p>

<p class="MsoNormal" style="text-align: justify;"><span class="GramE">wenn</span> es hangt an der
Nabelschnur.<span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></p>

<p class="MsoNormal" style="text-align: justify;"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal" style="text-align: justify;">/*German contestants please forgive me. I had to modify
something as they were not appearing correctly in plain text format*/</p>

<p class="MsoNormal" style="text-align: justify;"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal" style="text-align: justify;">A Schuttelreim seems to be a typical German invention. The
funny thing about this strange type of poetry is that if somebody gives you the
first line and the beginning of the second one, you can complete the poem
yourself. Well, even a computer can do that, and your task is to write a
program which completes them automatically. This will help Lara concentrate on
the &#8220;action&#8221; part of Tomb Raider and not on the &#8220;intellectual&#8221;
part.</p>

<h3 style="text-align: justify;"><span style="font-size: 18pt;">Input<o:p></o:p></span></h3>

<p class="MsoNormal" style="text-align: justify;">The input will begin with a line containing a single
number n. After this line follow n pairs of lines containing Schuttelreims. The
first line of each pair will be of the form</p>

<p class="MsoNormal" style="text-align: center;" align="center">s<sub>1</sub>&lt;s<sub>2</sub>&gt;s<sub>3</sub>&lt;s<sub>4</sub>&gt;s<sub>5</sub></p>

<p class="MsoNormal" style="text-align: justify;"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal" style="text-align: justify;"><span class="GramE">where</span> the s<sub>i</sub> are
possibly empty, strings of lowercase characters or blanks. The second line will
be a string of lowercase characters or blanks ending with three dots
&#8220;...&#8221;. Lines will <span class="GramE">we</span> at most 100
characters long.</p>

<h3 style="text-align: justify;"><span style="font-size: 18pt;">Output<o:p></o:p></span></h3>

<h3 style="text-align: justify;"><span style="font-size: 12pt; font-weight: normal;">For each pair of Schuttelreim lines l<sub>1</sub>
and l<sub>2</sub> you are to output two lines c<sub>1</sub> and c<sub>2</sub>
in the following way: c<sub>1</sub> is the same as l<sub>1</sub> only that the
bracket marks &#8220;&lt;&#8221; and &#8220;&gt;&#8221; are removed. Line c<sub>2</sub>
is the same as <span class="GramE">l<sub>2</sub> ,</span> except that instead of
the three dots the string s<sub>4</sub>s<sub>3</sub>s<sub>2</sub>s<sub>5</sub>
should appear.<o:p></o:p></span></h3>

<div>

<h3><span style="font-size: 18pt;">Sample Input<o:p></o:p></span></h3>

<p class="MsoNormal" style=""><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">3<o:p></o:p></span></p>

<p class="MsoNormal" style=""><span class="GramE"><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">ein</span></span><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;"> kind haelt seinen
&lt;schn&gt;abel &lt;n&gt;</span><st1:city><st1:place><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">ur</span></st1:place></st1:city><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>

<p class="MsoNormal" style=""><span class="GramE"><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">wenn</span></span><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;"> es haengt an der ...<o:p></o:p></span></p>

<p class="MsoNormal" style=""><span class="GramE"><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">weil</span></span><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;"> wir zu spaet zur
&lt;&gt;oma &lt;k&gt;amen<o:p></o:p></span></p>

<p class="MsoNormal" style=""><span class="GramE"><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">verpassten</span></span><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;"> wir das ...<o:p></o:p></span></p>

<p class="MsoNormal" style=""><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">&lt;d&gt;u &lt;b&gt;<span class="GramE">ist</span><o:p></o:p></span></p>

<p class="MsoNormal" style=""><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">...<o:p></o:p></span></p>

<h3 style=""><span style="font-size: 18pt;">Sample Output<o:p></o:p></span></h3>

</div>

<p class="MsoNormal" style=""><span class="GramE"><span style="font-size: 11pt; font-family: Courier;">ein</span></span><span style="font-size: 11pt; font-family: Courier;"> kind haelt seinen schnabel nur<o:p></o:p></span></p>

<p class="MsoNormal" style=""><span class="GramE"><span style="font-size: 11pt; font-family: Courier;">wenn</span></span><span style="font-size: 11pt; font-family: Courier;"> es haengt an der nabel schnur<o:p></o:p></span></p>

<p class="MsoNormal" style=""><span class="GramE"><span style="font-size: 11pt; font-family: Courier;">weil</span></span><span style="font-size: 11pt; font-family: Courier;"> wir zu spaet zur oma kamen<o:p></o:p></span></p>

<p class="MsoNormal" style=""><span class="GramE"><span style="font-size: 11pt; font-family: Courier;">verpassten</span></span><span style="font-size: 11pt; font-family: Courier;"> wir das koma amen<o:p></o:p></span></p>

<p class="MsoNormal" style=""><span class="GramE"><span style="font-size: 11pt; font-family: Courier;">du</span></span><span style="font-size: 11pt; font-family: Courier;"> bist<o:p></o:p></span></p>

<p class="MsoNormal" style=""><span class="GramE"><span style="font-size: 11pt; font-family: Courier;">bu</span></span><span style="font-size: 11pt; font-family: Courier;"> dist</span><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>

<div class="MsoNormal" style="text-align: center;" align="center">

<hr align="center" size="2" width="100%">

</div>

<p class="MsoNormal" style=""><b style="">TUD Programming Contest<o:p></o:p></b></p>

</div>

</body></html>